#ifndef _BUOLA_MEDIA_FFMPEG_CINPUTVIDEOSTREAM_H_
#define _BUOLA_MEDIA_FFMPEG_CINPUTVIDEOSTREAM_H_

#include "cinputstream.h"

#include <blackbox/cdataout.h>
#include <blackbox/cclockout.h>
#include <buola/image/format.h>

namespace buola { namespace media { namespace ffmpeg {

class CInputVideoStream : public CInputStream
{
public:
    CInputVideoStream(AVStream *pAV);

    void SetPorts(blackbox::CDataOut<img::CImage_rgb8> *pOut,blackbox::CClockOut *pClock);

    virtual void ProcessPacket(AVPacket *pPacket);
    
private:
    AVStream *mAV;
    AVFrame *mFrame;
    AVFrame *mFrameOut;
    SwsContext *mConvert;
    
    blackbox::CDataOut<img::CImage_rgb8> *oVideo;
    blackbox::CClockOut *kVideo;
};

/*namespace ffmpeg*/ } /*namespace media*/ } /*namespace buola*/ }

#endif
